package com.hs.excel.demos.service;


import com.alibaba.excel.EasyExcel;
import com.hs.excel.demos.listenter.Comont;
import com.hs.excel.demos.listenter.InsertListener;
import com.hs.excel.demos.pojo.RequestParm;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("excelToSqlInsertImp")
public class ExcelToSqlInsertImp implements ExcelToSql{

    @Override
    public List<String> transformSql(RequestParm requestParm) {
        Comont.insertList.clear();
        EasyExcel.read(requestParm.getFilename(), new InsertListener(new RequestParm("USER",false,"mysql"))).sheet().doRead();
        return Comont.insertList;
    }
}
